#include<stdio.h>

int main()
{
	int n;
	scanf("%d",&n);
	if(n<1) printf("%d",n);
	else if(n<=10) printf("%d",2*n-1);
	else printf("%d",3*n-11);
	return 0;
}
